package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.anno.AutoFill;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.enumeration.OperationType;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @program: sky-take-out
 * @description:
 * @author: fmp
 * @create: 2023-04-09 15:10
 * @Version 1.0
 **/
@Mapper
public interface SetMealMapper {
   //根据id查询返回数量
   Long selectById(Long id);
   //新增套餐
   @AutoFill(OperationType.INSERT)
   void insertSetMeal(@Param("setmeal") Setmeal setmeal);
   //分页查询
    Page<SetmealVO> SelectPageQuery(@Param("setmealPageQueryDTO") SetmealPageQueryDTO setmealPageQueryDTO);
   //跟新套餐信息
   @AutoFill(OperationType.UPDATE)
   void updateSetmeal(@Param("setmeal") Setmeal setmeal);
   //查询售卖状态
   List<Setmeal> SelectStatusById(@Param("ids") List<Long> ids);
   //根据id删除
   void deleteByid(@Param("ids") List<Long> ids);
   //返回status集合
   List<Integer> selectByidForStatus(@Param("setmeal") Setmeal setmeal);


    List<Setmeal> selectByCondition(@Param("conditionSetmeal") Setmeal conditionSetmeal);
   //通过id查询返回对象
    Setmeal selectBySetmealId(@Param("setmealId") Long setmealId);

    Integer selectSetmealCOuntByStatus(Integer enable);
}
